# -*- coding:utf-8 -*-
# author: lkz
# date: 2015/11/06 10:13

import time
import random

from proj.celery_config import test_celery
from proj.base import get_db_session, db_session
from proj.models import Test


@test_celery.task()
def test_sleep(id):
    # with get_db_session() as db_session:
    #     t = db_session.query(Test.id).filter(Test.id == id)
    #     if t:
    #         print t[0]

    t = db_session.query(Test.id).filter(Test.id == id).all()
    #db_session.remove()

    if t:
        print t[0]


